<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="order" tagdir="/WEB-INF/tags/order"%>
<%@ taglib prefix="customer" tagdir="/WEB-INF/tags/customer"%>

<content tag="buttons">	 
  	<probiz:iconBtn btnType="back" onclick="returnToList();" />
</content>
<div class="top clearfix">
	<ul class="tab">
		<li class="curr"><span><fmt:message key="salesOrder.editPanel.title"/></span></li>
	</ul>
</div>

<div class="modify">
	<form name="orderEditPanel" id="orderEditPanel" method="post" action="">
		<input type="hidden" id="salesOrderId" name="salesOrderId" value="${order.salesOrderId}"/>
		
		<%---------------------------------start:客户与货品 -------------------------%>
		<%@include file="include/orderEditPanel4CustomerAndProduct.jsp" %>
		<%---------------------------------end:  客户与货品 -------------------------%>
		
		<%---------------------------------start:订单信息 -------------------------%>
		<div id="orderDetail">
			<%@include file="include/orderEditPanel4OrderInfo.jsp"%>
		</div>
		<%---------------------------------end:  订单信息 -------------------------%>
		
		<%-- 重要，记录订单使用的优惠券号，为了之后的订单计算中与前台下单数据保存一致--%>
		<input type="hidden" name="usedCouponNo" value="${order.usedCouponNo}"/>
	</form>
</div>

<%---------------------------------start:商品选择器 -------------------------%>
<div style="display:none;">
	<product:productSkuSelector selectorId="productSkuSelector" multiple="true" callbackFunc="addProductSkuCallback"/>
<%---------------------------------end:  商品选择器 -------------------------%>
</div>

<script type="text/javascript">

$j(document).ready(function () {
	<%---------------------------------start:货品 -------------------------%>
	<c:forEach items="${order.orderSkus4Product}" var="orderSku">
		addProductSkuCallback([{
			"productSkuId":${orderSku.productSkuId},
			"productSkuCode":"${orderSku.productSkuCode}",
			"minOrderQuantity":${orderSku.quantity},
			"productName":"${orderSku.productName}",
			"imageUrl":"${orderSku.productSku.imageUrl}",
			"orderSkuDisplayOption":"${orderSku.productSku.orderSkuDisplayOption}"}],true);
	</c:forEach>
	<%---------------------------------end:  货品 -------------------------%>
	
	autoApplyValidate($('orderEditPanel'));
});	

</script>
